package com.twu.biblioteca.representation;

import com.twu.biblioteca.representation.command.Command;

public class BibliotecaApp {

    private static String WELCOME_INFO = "welcome to Biblioteca!";

    public static void main(String[] args) {
        CommandExecutor ce = new CommandExecutor();
        MainMenu mainMenu = new MainMenu();
        String resultStr;
        System.out.println(WELCOME_INFO);

        while(true) {
            System.out.println(mainMenu.showMenu());
            mainMenu.inputOption();
            if(mainMenu.isOptionValid()) {
                Command cmd = ce.parseOption(mainMenu.getOptionStr());
                resultStr = ce.executeCommand(cmd);
                System.out.println(resultStr);
            }
            else
                continue;
        }

    }
}

